package com.atguigu.gmall.feign.product;

import com.atguigu.gmall.model.product.BaseCategoryView;
import com.atguigu.gmall.model.rpc.product.BaseCategory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@RequestMapping("/api/inner")
@FeignClient("service-product")   //说明这是一个远程调用客户端
public interface CategoryFeignClient {

    @GetMapping("/category/all")
    List<BaseCategory> getAllCategory();

    @GetMapping("/category/sku/{skuId}")
    BaseCategoryView getCategoryPathBySkuId(@PathVariable("skuId") Long skuId);
}